<template>
  <div class="div1">
    <h2>父子组件</h2>
    <span>{{ car }}</span><button @click="sendCar">传递</button><br/>
    <TongXin3Child1/>
    <TongXin3Child2/>
  </div>
</template>
<script setup lang="ts">
import TongXin3Child1 from './TongXin3Child1.vue';
import TongXin3Child2 from './TongXin3Child2.vue';
import emitter from '@/utils/emitter';

import { ref } from 'vue';

const car = ref('奥迪');

const sendCar = () => {
  emitter.emit('send-car', car);
};

</script>

<style lang="scss" scoped>
.div1 {
  background-color: #f5f5f5;
  padding: 20px;
  border: 1px solid #eee;
}

</style>
